package grammarbot;

import groovy.util.GroovyTestCase

class TweetCheckerTest extends GroovyTestCase {

  void testTweeter() {
    def tweetChecker = new TweetChecker()
    def check = tweetChecker.check("john", "This is a oar.")
    assert check.startsWith("@john")
    assert check.contains("an")
  }

  void testExtract() {
    def tweetChecker = new TweetChecker()
    assert tweetChecker.extractSentenceRegion("This an big dog", "a", 5, 7) == "This a big dog"

    assert tweetChecker.extractSentenceRegion("This is definitely an cheerful clown", "a", 19, 21)  == "...efinitely a cheerful ..."

  }

}